package com.dragon.modules.yuegou.mybatis;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Between操作符
 * 
 * @author liuwu
 *
 * @param <T>
 */
@JsonInclude(Include.NON_NULL)
public class Between<T extends Comparable<? super T>>{

	@JsonProperty("From")
	private T from;

	@JsonProperty("To")
	private T to;

	public Between() {
		super();
	}

	public Between(T from, T to) {
		super();
		this.from = from;
		this.to = to;
	}

	public T getFrom() {
		return from;
	}

	public void setFrom(T from) {
		this.from = from;
	}

	public T getTo() {
		return to;
	}

	public void setTo(T to) {
		this.to = to;
	}

	@Override
	public String toString() {
		return "Between [from=" + from + ", to=" + to + "]";
	}

	@JsonIgnore
	public boolean isNotEmpty() {
		return ObjectHelper.isNotEmpty(from) && ObjectHelper.isNotEmpty(to);
	}
}
